package com.zmj.controller;

import com.zmj.comm.SystemURL;
import com.zmj.comm.SystemUser;
import com.zmj.entity.User;
import com.zmj.service.UserService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class UserController {

    @Autowired
    UserService userService;

    @RequestMapping(SystemURL.ADD_URL)
    public String addUser(){
        User user=new User();
        user.setPassword(SystemUser.USER_PASS);
        user.setUsername(SystemUser.USER_NAME);
        user.setEmail(SystemUser.USER_EMAIL);
        boolean flg=userService.addUser(user);
        System.out.println(flg);
        return SystemURL.INDEX_URL;
    }
}
